package org.code.JucDataLearn.config;


import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: workflow-server
 * @BelongsPackage: com.server.config
 * @Author: Chen Wei
 * @CreateTime: 2023-11-02  16:58
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration//告诉spring他是一个配置类
@MapperScan("org.code.JucDataLearn.Mapper")//扫描mapper接口所在的包
@SuppressWarnings("all")
public class MyBatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //添加分页插件
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.ORACLE));
        return  interceptor;
    }

}
